package com.mqz.zebraEcommerce.commodity.web;

import com.mqz.zebraEcommerce.commodity.entity.SkuInfoEntity;
import com.mqz.zebraEcommerce.commodity.service.SkuInfoService;
import com.mqz.zebraEcommerce.commodity.vo.SearchResultVO;
import com.mqz.zebraEcommerce.common.utils.PageUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Controller
public class SearchController {
    @Resource
    private SkuInfoService skuInfoService;

    @RequestMapping("/list.html")
    public String searchList(@RequestParam Map<String, Object> params, Model model) {

        SearchResultVO searchResultVO = skuInfoService.searchPage(params);
        model.addAttribute("result", searchResultVO);

        return "list";
    }
}
